<table class="table table-hover">
    <thead>
    <tr>
        <th>SKU</th>
        <th>季节性</th>
        <th>品类</th>
        <th>在库</th>
        <th>在途</th>
        <th>保留</th>
        <th>产品名称</th>
        <th>操作</th>
    </tr>
    <tr style="color:#f56f9c">
        <td>TTL</td>
        <td></td>
        <td></td>
        <td>{{ array_key_exists('instant',$total) ? $total['instant'] : '' }}</td>
        <td>{{ array_key_exists('transit',$total) ? $total['transit'] : '' }}</td>
        <td>{{ array_key_exists('reserve',$total) ? $total['reserve'] : '' }}</td>
        <td></td>
        <td></td>
    </tr>
    </thead>
    <tbody>
    @foreach($paginator as $row)
        <tr>
            <td>{{ $row->sku->psku_code ?? '' }}</td>
            <td>{{ App\Models\Product\ProductClassify::$_season[$row->sku->classify->season ?? 3] }}</td>
            <td>{{ $row->sku->classify->title ?? '' }}</td>
            <td>{{ $row->instant }}</td>
            <td>{{ $row->transit }}</td>
            <td>{{ $row->reserve }}</td>
            <td>{{ $row->sku->psku_cn ?? '' }}</td>
            <td><button class="btn btn-xs btn-info t-modal" data-id="{{ $row->id }}">挪用</button></td>
        </tr>
    @endforeach
    </tbody>
</table>
<div class="modal fade" id="tModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- 内容会加载到这里 -->
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('.t-modal').on('click', function(e) {
            e.preventDefault();
            var id = $(this).data('id');
            $("#tModal").modal({
                remote : '/xqc/inventory/transfer-p-modal?action=transferModal&param=' + id
            });
        });
        $("#tModal").on("hidden.bs.modal", function() {
            $(this).removeData("bs.modal");
            $(this).find(".modal-content").children().remove();
        });
    });
</script>
